<div id="add_story_btn" onclick="getUlr(1)">
  <div class="add_story_btn_style">全部款式</div>
</div>
<div id="add_story_btn" onclick="getUlr(2)">
  <div class="add_story_btn_style">最新款式</div>
</div>
<div id="add_story_btn" onclick="getUlr(3)" style="background-color:#eeeeee;color:black">
  <div class="add_story_btn_style">详细分类</div>
</div>

<div class="add_clear"></div>

<form action="{:U('Shose/doSearch')}" method="GET">
  <p><center>
    <select name="search_type" id="search_type" class="add_story_bar" style="width:94%;height:40px">
      <option value="1">按类型查询</option>
      <option value="2">按名称查询</option>
      <option value="3">按价格查询</option>
    </select>
  </center></p>
  <p><center><input type="text" id="type" name="type" class="add_story_bar" placeholder="请输入款式类型" id="com_2"></center></p>
  <p><center><input type="text" id="name" name="name" class="add_story_bar" placeholder="请输入款式名称" id="com_2"></center></p>
  <p><center><input type="text" id="price" name="price" class="add_story_bar" placeholder="请输入款式价位" id="com_2"></center></p>
  <p><input type="submit" name="submit" value="精确搜索" class="add_story_submit" onclick="return check_form2()"></p>
</form>

<volist name="categories" id="category">
<div id="add_story_btn"  onclick="javascript:document.location.href ='{:U('Shose/categoryPage', array('id' => $category['id']))}'">
  <div class="add_story_btn_style">{$category['name']}</div>
</div>
</volist>

<script>

$(function() {
    $('#type').show();
    $('#name').hide();
    $('#price').hide();

    $('#search_type').change(function() {
        if ($(this).val() == 1) {
             $('#type').show();
             $('#name').hide();
             $('#price').hide();
        } else if ($(this).val() == 2) {
             $('#type').hide();
             $('#name').show();
             $('#price').hide();
        } else if ($(this).val() == 3) {
             $('#type').hide();
             $('#name').hide();
             $('#price').show();
        }
    });
});

function check_form2() {
    var search_type = $('#search_type').val();
    var type = $('#type').val();
    var name = $('#name').val();
    var price = $('#price').val();

    if (1 == search_type && !type) {
      alert('请输入需要查询的类型！');
      return false;
    } else if (2 == search_type && !name) {
      alert('请输入需要查询的鞋品名称！');
      return false;
    } else if (3 == search_type && !price) {
      alert('请输入需要查询的价格范围！');
      return false;
    }

    return true;
}
</script>

<include file='Shose:javascript' />
